package com.koron.housing.contract.bean.param;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.apache.commons.lang3.time.DateFormatUtils;

import java.util.Date;

/**
 * @author jzp
 * @since 2022/3/8
 */
@Data
@ApiModel(value = "财务报销参数", description = "HousingContractBillParam")
public class HousingContractBillParam {
    @ApiModelProperty("财务报销编号")
    private String billCode;
    @ApiModelProperty("月份")
    private Integer month;
    @ApiModelProperty("年份")
    private Integer year;

    public Integer getYear() {
        if (year == null) {
            return Integer.parseInt(DateFormatUtils.format(new Date(), "yyyy"));
        }
        return year;
    }
}
